package veda;

import cn.hutool.core.date.DateUtil;
import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import java.io.UnsupportedEncodingException;
import java.util.Date;

/**
 * @author zhupengfei
 * @date 2023/11/4
 */
public class SHOP {

    public static void main(String[] args) throws UnsupportedEncodingException {
        Algorithm algorithm = Algorithm.HMAC256("4F8hAL8U8iUndNSszdd7tEprxkRW36fU");
        String token = JWT.create().withIssuer("dpoPbofa1qsFQB00pkfo616JsvUHAus0")
                .withIssuedAt(new Date())
                .withExpiresAt(DateUtil.offsetMinute(new Date(),60))
                .sign(algorithm);
        System.out.println("prod:" + token);


        Algorithm algorithm2 = Algorithm.HMAC256("eyRm7Uwap37vcDKYjpS3oCBhhrqHvML3");
        String token2 = JWT.create().withIssuer("y7bTXmAliqmW9thGutWlzX1eq6BQiMax")
                .withIssuedAt(new Date())
                .withExpiresAt(DateUtil.offsetMinute(new Date(),60))
                .sign(algorithm2);
        System.out.println("test:" + token2);


        Algorithm algorithm3 = Algorithm.HMAC256("l38uK9bt943TkJPlfTGGCPtRnmb7bPtK");
        String token3 = JWT.create().withIssuer("USd3HxFyhirum28M725hrclBByDS7yN3")
                .withIssuedAt(new Date())
                .withExpiresAt(DateUtil.offsetMinute(new Date(),60))
                .sign(algorithm3);
        System.out.println("mall:" + token3);
    }
}
